@extends('layouts.admin.application')

@section('css')
    <link rel="stylesheet" href="/vendor/daterangepicker/daterangepicker.css">
@endsection

@section('content')

    <div class="admin-content">

        <div class="am-cf am-padding">
            <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">新增挑战</strong> /
                <small>Create</small>
            </div>
        </div>
        <hr>
        @include('admin._flash')

        <div class="am-g">
            <div class="am-u-sm-12 am-u-md-12">

                <form class="am-form" action="/admin/pack" method="post">
                    {{ csrf_field() }}

                    <div class="am-g am-margin-top">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            所属门店
                        </div>
                        <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                            <select  data-am-selected="{btnWidth: '100%',  btnStyle: 'secondary', btnSize: 'sm', maxHeight: 360, searchBox: 1}"
                                     name="store_id">
                                <option value="">请选择</option>
                                @foreach($cates as $c)
                                    <option value="{{$c->id}}" >{{$c->name}}</option>
                                @endforeach
                            </select>
                        </div>
                    </div>

                    <div class="am-g am-margin-top">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            挑战名称
                        </div>
                        <div class="am-u-sm-8 am-u-md-4">
                            <input type="text" class="am-input-sm"  name="name">
                        </div>
                        <div class="am-hide-sm-only am-u-md-6">请填写唯一挑战名称</div>
                    </div>


                    <div class="am-g am-margin-top">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            套餐标签
                        </div>
                        <div class="am-u-sm-8 am-u-md-4">
                            <input type="text" class="am-input-sm" name="tag">
                        </div>
                        <div class="am-hide-sm-only am-u-md-6">*请填写套餐标签</div>
                    </div>
                    <div class="am-g am-margin-top">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            套餐简述
                        </div>
                        <div class="am-u-sm-8 am-u-md-4">
                            <input type="text" class="am-input-sm" name="des">
                        </div>
                        <div class="am-hide-sm-only am-u-md-6">*请填写套餐简述</div>
                    </div>

                    <div class="am-g am-margin-top">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            缩略图
                        </div>

                        <div class="am-u-sm-8 am-u-md-8 am-u-end col-end">
                            <div class="am-form-group am-form-file new_thumb">
                                <button type="button" class="am-btn am-btn-success am-btn-sm">
                                    <i class="am-icon-cloud-upload" id="loading"></i> 上传新的缩略图
                                </button>
                                <input type="file" id="image_upload">
                                <input type="hidden" name="image" value="">
                            </div>

                            <hr data-am-widget="divider" style="" class="am-divider am-divider-dashed"/>

                            <div>
                                <img src="" id="img_show" style="max-height: 200px;" >
                            </div>
                        </div>
                    </div>

                    <div class="am-g am-margin-top sort">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            排序
                        </div>
                        <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                            <input type="text" name="sort" class="am-input-sm" value="">
                        </div>
                    </div>

                    <div class="am-g am-margin-top sort">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            价格
                        </div>
                        <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                            <input type="text" name="price" placeholder="单价：元" class="am-input-sm" value="">
                        </div>
                        <div class="am-hide-sm-only am-u-md-6">*挑战总价格，如999元则填写999</div>
                    </div>
                    <div class="am-g am-margin-top sort">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            返还次数
                        </div>
                        <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                            <input type="text" name="time_number"placeholder="单位：次" class="am-input-sm" value="">
                        </div>
                        <div class="am-hide-sm-only am-u-md-6">*返还次数，如10次则填写10</div>
                    </div>
                    <div class="am-g am-margin-top sort">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            单次返还价格
                        </div>
                        <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                            <input type="text" name="one_price" placeholder="单价：元" class="am-input-sm" value="">
                        </div>
                        <div class="am-hide-sm-only am-u-md-6">*单次返还价格，如99元则填写99</div>
                    </div>
                    <div class="am-g am-margin-top sort">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                           是否上架
                        </div>
                        <label class="am-btn am-btn-default am-btn-xs am-round">
                            <input type="radio" name="is_use" value="1" > 是
                        </label>
                        <label class="am-btn am-btn-default am-btn-xs am-round">
                            <input type="radio" name="is_use" value="0">否
                        </label>
                    </div>
                    <div class="am-g am-margin-top sort">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            是否可重复
                        </div>
                        <label class="am-btn am-btn-default am-btn-xs am-round">
                            <input type="radio" name="can_re" value="1" > 是
                        </label>
                        <label class="am-btn am-btn-default am-btn-xs am-round">
                            <input type="radio" name="can_re" value="0">否
                        </label>
                    </div>

                    {{--<div class="am-btn-group" data-am-button="">--}}
                        {{--<label class="am-btn am-btn-default am-btn-xs am-round">--}}
                            {{--<input type="checkbox" name="is_top" value="1"> 置顶--}}
                        {{--</label>--}}
                        {{--<label class="am-btn am-btn-default am-btn-xs am-round">--}}
                            {{--<input type="checkbox" name="is_recommend" value="1"> 推荐--}}
                        {{--</label>--}}
                 {{----}}
                    {{--</div>--}}

                    <div class="am-margin">
                        <button type="submit" class="am-btn am-btn-primary am-radius">提交保存</button>
                    </div>
                </form>
            </div>
        </div>
    </div>


@endsection
@section('js')
    <script src="/vendor/html5-fileupload/jquery.html5-fileupload.js"></script>
    <script src="/js/upload.js"></script>



  <script>
$(function () {
//文件上传
    //文件上传





})


  </script>
@endsection